/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.kucukcezve.tabu;

import java.util.Vector;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import net.kucukcezve.tabu.menu.MenuCanvas;

/**
 *
 * @author cemal
 * @mail cemal.yilmaz@gmail.com
 *
 */
public class TabuMIDlet extends MIDlet {

    public TabuCanvas canvas;
    private Display display;
    private MenuCanvas menu;

    protected void startApp() throws MIDletStateChangeException {
        Vector m = getMenu();
        menu = new MenuCanvas(this, m);
        initMIDlet();
    }

    private Vector getMenu() {
        Vector m = new Vector();
        m.addElement("New Game");
        m.addElement("Continue");
        m.addElement("Exit");
        return m;
    }

    private void initMIDlet() {
        display = Display.getDisplay(this);
        new SplashScreen(display, menu);
    }

    protected void pauseApp() {
    }

    protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
    }

    public void newGame() {
        canvas = new TabuCanvas();
        display.setCurrent(canvas);
    }
}
